POV-Ray : Newsgroups : povray.beta-test : Filling in T values in splines : Filling in T values in splines Server Time
29 Jul 2024 22:31:58 EDT (-0400)
  Filling in T values in splines  
From: Rune
Date: 23 Feb 2002 21:13:53
Message: <3c784c61@news.povray.org>
As Warp has pointed out, it would be convenient if one was not forced to
specify T values for all the control points in a spline. I've tried making a
macro which fill in the missing T values. It takes an array as input.

But I had forgotten that arrays do not allow abbreviating vectors as floats,
as it is allowed almost everywhere else in POV-Ray. So the syntax is uglier
than what I had hoped. The idea is that specified T values are multiplied
with y, while unspecified T values are marked with an x. See below.

My question is - is the below syntax too ugly or would it be acceptable for
a macro included in the POV-Ray distribution?

#declare SplineArray =
array[7*2] {
   0.0*y, <0,1,2>,
       x, <1,5,0>,
       x, <4,1,0>,
   0.9*y, <0,2,1>,
   1.0*y, <0,0,1>,
       x, <6,5,4>,
   2.0*y, <4,3,2>,
}

#declare Spline =
spline {
   cubic_spline
   SplineAutoT(SplineArray)
}

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Feb 16)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.